package cn.rkylin.oms.warehouse.shiporder.service;

import java.util.List;
import java.util.Map;

import com.github.pagehelper.PageInfo;

import cn.rkylin.oms.warehouse.shiporder.vo.ShiporderSkuVO;
import cn.rkylin.oms.warehouse.shiporder.vo.ShiporderVO;

/**
 * 发货Service
 * 
 * @author 齐涛
 * @version 1.0
 * @created 28-9-2017 10:51:30
 */
public interface IShiporderService {

    /**
     * 根据条件取得数量
     * @param params
     * @return
     * @throws Exception
     */
    public int selectCount(Map<String,Object> params) throws Exception;
    
    /**
     * 查询发货单列表
     * 
     * @param page
     *            页号
     * @param rows
     *            页大小
     * @param shiporderVO
     *            发货单VO
     * @return 发货单列表
     * @throws Exception
     *             异常
     */
    @SuppressWarnings("rawtypes")
    public PageInfo findByWhere(int page, int rows, ShiporderVO shiporderVO) throws Exception;

    public PageInfo findByWhereLocal(int page, int rows, ShiporderVO shiporderVO) throws Exception;

    public PageInfo findByWhereForOrder(int page, int rows, ShiporderVO shiporderVO) throws Exception ;

    public Map<String, Object> updateShiporder(ShiporderVO shiporderVO) throws Exception;
    /**
     * 查询发货单信息
     * 
     * @param shiporderVO
     *            发货单VO
     * @return 发货单信息
     * @throws Exception
     *             异常
     */
    public ShiporderVO getShiporderInfo(ShiporderVO shiporderVO) throws Exception;

    public Map<String, Object> batchSystemSend(List<ShiporderVO> shiporderVOList) throws Exception;

    /**
     * 查询发货单信息
     * 
     * @param shiporderVO
     *            发货单VO
     * @return 发货单列表
     * @throws Exception
     *             异常
     */
    public List<ShiporderVO> getShiporderList(ShiporderVO shiporderVO) throws Exception;

    /**
     * 查询发货单商品列表
     * 
     * @param shiporderGoodsVO
     *            发货单商品VO
     * @return 发货单信息
     * @throws Exception
     *             异常
     */
    public List<ShiporderSkuVO> selectShiporderSkuList(ShiporderSkuVO shiporderSkuVO) throws Exception;

    /**
     * 取消发货单为补发单
     *
     * @param shiporderId
     *            发货单Id
     * @throws Exception
     *             异常
     * @return 取消结果信息
     */
    public String cancelShiporder(String shiporderId) throws Exception;

    /**
     * 取消发货单
     *
     * @param shiporderVO
     *            发货单VO
     * @throws Exception
     *             异常
     * @return 取消结果信息
     */
    public String saveCancelShiporder(ShiporderVO shiporderVO) throws Exception;

    /**
     * 平台发货
     *
     * @param shiporderVO
     *            发货单VO
     * @throws Exception
     *             异常
     * @return 取消结果信息
     */
    public Map<String, String> consign(ShiporderVO shiporderVO) throws Exception;

    /**
     * 锁定发货单为退款单
     *
     * @param orderId
     *            订单Id
     * @throws Exception
     *             异常
     * @return 结果信息
     */
    public String lockForSysRefund(String orderId) throws Exception;

    /**
     * 根据订单锁定发货单
     * 
     * @param orderId
     * @return
     * @throws Exception
     */
    public Map<String, String> lock(String orderId) throws Exception;

    /**
     * 解锁发货的 wangxing add 2017-12-9
     * 
     * @param orderId
     * @return
     * @throws Exception
     */
    public Map<String, String> unLock(String orderId) throws Exception;

    /**
     * 系统发货单主表信息插入数据库
     *
     * @param shiporderVO
     * @return
     * @throws Exception
     */
    public int insertSelectiveShiporder(ShiporderVO shiporderVO) throws Exception;

    /**
     * 系统发货单商品明细表信息插入数据库
     *
     * @param shiporderSku
     * @return
     * @throws Exception
     */
    public int insertSelectiveShiporderSku(ShiporderSkuVO shiporderSkuVO) throws Exception;

    /**
     * getUnGoingCount:获取进行中的单据数量. <br/>
     *
     * @author zhanghao
     * @param paramMap
     * @return
     * @throws Exception
     */
    public int getUnGoingCount(Map<String, String> paramMap) throws Exception;
}
